
#ifndef CT_H
#define CT_H
#include "peripheral/impTypes.h"
#include "peripheral/bhm.h"
#include "peripheral/ppm.h"

#define LOG(_FMT, ...)  bhmPrintf( "CRANK TIMER: " _FMT,  ## __VA_ARGS__)

//////////////////////////////////// Externs ///////////////////////////////////
extern Uns32 diagnosticLevel;
ppmNetValue nextValue;
ppmNetValue nextTime;


////////////////////////// Register data declaration //////////////////////////
typedef struct WORDREADCSP_ab32_dataS { 
    union { 
        Uns32 value;
    } wordData;
} WORDREADCSP_ab32_dataT, *WORDREADCSP_ab32_dataTP;

/////////////////////////////// Port Declarations //////////////////////////////
extern WORDREADCSP_ab32_dataT WORDREADCSP_ab32_data;


///////////////////////////////// Port handles /////////////////////////////////
typedef struct handlesS {
	void                 *WORDREADCSP;
	ppmNetHandle          intp;
	ppmNetHandle 		  readNextTime;
	ppmNetHandle		  readNextValue;
} handlesT, *handlesTP;

extern handlesT handles;

PPM_REG_READ_CB(regRd32);
PPM_CONSTRUCTOR_CB(periphConstructor);
PPM_CONSTRUCTOR_CB(constructor);
PPM_DESTRUCTOR_CB(destructor);
PPM_NET_CB(wroteNewValue);


#endif
